<template>
  <div>
    <!-- 带类型声明defineEmits({ }) -->
    <button @click="edit">验证</button>
  </div>
</template>

<script lang="ts" setup>
//带类型声明defineEmits({ })
const emit = defineEmits({
  submit(payload: { email: string; password: string }) {
    if (payload.email == payload.password) {
      return true;
    }
    return false;
  },
});
const edit = () => {
  emit('submit', { email: '222', password: '333' });
};
</script>
